#include <stdio.h>
#include <stdlib.h>
#include <sys/statvfs.h>

int main() {
    struct statvfs vfs;
    if (statvfs("/", &vfs) == -1) {
        perror("Failed to get disk usage");
        return 1;
    }

    unsigned long long totalSpace = vfs.f_blocks * vfs.f_frsize;
    unsigned long long freeSpace = vfs.f_bfree * vfs.f_frsize;
    unsigned long long usedSpace = totalSpace - freeSpace;
    double percentUsed = (double)usedSpace / totalSpace * 100.0;

    printf("Disk Usage: %.2f%%\n", percentUsed);

    return 0;
}

